#include "Refrigerator.h"
#include <iostream>
using namespace std;

void Refrigerator::openDoor() {
    if (!isDoorOpen) {
        isDoorOpen = true;
        cout << "冰箱门已打开" << endl;
    } else {
        cout << "冰箱门已处于打开状态" << endl;
    }
}
void Refrigerator::closeDoor() {
    if (isDoorOpen) {
        isDoorOpen = false;
        cout << "冰箱门已关闭" << endl;
    } else {
        cout << "冰箱门已处于关闭状态" << endl;
    }
}

// 实现获取冰箱门状态的函数
bool Refrigerator::getDoorStatus() const {
    return isDoorOpen;
}
